//
//  UITextField+FJKResignFirstResponder.m
//  FangGeek
//
//  Created by FangGeek on 16/9/17.
//  Copyright © 2016年 FangGeek. All rights reserved.
//

#import "UITextField+FJKResignFirstResponder.h"

@implementation UITextField (FJKResignFirstResponder)
+(void)AllResignFirstResponder
{

   [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

}
- (void) selectTextAtRange:(NSRange)range
{
    UITextPosition* beginning = self.beginningOfDocument;
    
    UITextPosition* startPosition = [self positionFromPosition:beginning offset:range.location];
    UITextPosition* endPosition = [self positionFromPosition:beginning offset:range.location + range.length];
    UITextRange* selectionRange = [self textRangeFromPosition:startPosition toPosition:endPosition];
    
    [self setSelectedTextRange:selectionRange];
}
@end
